from calibre.web.feeds.recipes import BasicNewsRecipe
     
class Git_Pocket_Guide(BasicNewsRecipe):
     
    title = '我的绝色校花老婆'
    description = ''
    cover_url = 'http://img1.hongshu.com/bookface/5/81/58193_large.jpg'
     
    url_prefix = 'http://www.hongshu.com/bookreader/58193/'
    no_stylesheets = True
    # keep_only_tags = [{ 'class': 'toctree-l1' }]
     
    def get_title(self, link):
        return link.contents[0].strip()
     
    def parse_index(self):
        soup = self.index_to_soup(self.url_prefix )
         
        div = soup.find('table',{'class':'list2'})
         
        articles = []
        for link in div.findAll('a'):
            url_str = link['href']
            if not url_str.endswith("html"):
                continue
         
            til = self.get_title(link)
            url = url_str
            a = { 'title': til, 'url': url }
         
            articles.append(a)
         
        ans = [('我的绝色校花老婆', articles)]
         
        return ans